<?php
/**
 * 
 * 2013-10-15 UTF-8
 * @author Rex Lee
 *
 */
class Validatebbs {
	/**
	 * 登陆验证
	 * @param unknown $username
	 * @param unknown $password
	 * @return boolean true密码正确
	 */
	static function check($username, $password) {
		$rst=M("ucenter_members","pre_","DB_CONFIG2")->where(array('username'=>$username))->find();
		$pwd=md5(md5($password).$rst['salt']);
		if($rst['password']==$pwd){
			session('[start]');
			session('user',$username);
			cookie(C('SID_COOKIE_NAME'),session_id());
			return true;
		}
	}
	
}